package com.itheima.Test002;

import java.util.Objects;

public class Student {
    /*
    请按标准格式定义一个“学生类”，它有三个属性：姓名、性别、年龄
	请编写测试类，创建两个“学生对象”并为它们的属性赋值，
	并能比较两个对象的所有属性值是否完全相等
     */
    private String name ;
    private char sex;
    private  int age;
    public Student() {
    }
    public Student(String name, char sex, int age) {
        this.name = name;
        this.sex = sex;
        this.age = age;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return sex == student.sex &&
                age == student.age &&
                Objects.equals(name, student.name);
    }


}
